package com.ruoyi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.CookbookTypeMapper;
import com.ruoyi.domain.CookbookType;
import com.ruoyi.service.ICookbookTypeService;

/**
 * 食谱标签管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-22
 */
@Service
public class CookbookTypeServiceImpl implements ICookbookTypeService 
{
    @Autowired
    private CookbookTypeMapper cookbookTypeMapper;

    /**
     * 查询食谱标签管理
     * 
     * @param id 食谱标签管理主键
     * @return 食谱标签管理
     */
    @Override
    public CookbookType selectCookbookTypeById(Long id)
    {
        return cookbookTypeMapper.selectCookbookTypeById(id);
    }

    /**
     * 查询食谱标签管理列表
     * 
     * @param cookbookType 食谱标签管理
     * @return 食谱标签管理
     */
    @Override
    public List<CookbookType> selectCookbookTypeList(CookbookType cookbookType)
    {
        return cookbookTypeMapper.selectCookbookTypeList(cookbookType);
    }

    /**
     * 新增食谱标签管理
     * 
     * @param cookbookType 食谱标签管理
     * @return 结果
     */
    @Override
    public int insertCookbookType(CookbookType cookbookType)
    {
        cookbookType.setCreateTime(DateUtils.getNowDate());
        return cookbookTypeMapper.insertCookbookType(cookbookType);
    }

    /**
     * 修改食谱标签管理
     * 
     * @param cookbookType 食谱标签管理
     * @return 结果
     */
    @Override
    public int updateCookbookType(CookbookType cookbookType)
    {
        cookbookType.setUpdateTime(DateUtils.getNowDate());
        return cookbookTypeMapper.updateCookbookType(cookbookType);
    }

    /**
     * 批量删除食谱标签管理
     * 
     * @param ids 需要删除的食谱标签管理主键
     * @return 结果
     */
    @Override
    public int deleteCookbookTypeByIds(Long[] ids)
    {
        return cookbookTypeMapper.deleteCookbookTypeByIds(ids);
    }

    /**
     * 删除食谱标签管理信息
     * 
     * @param id 食谱标签管理主键
     * @return 结果
     */
    @Override
    public int deleteCookbookTypeById(Long id)
    {
        return cookbookTypeMapper.deleteCookbookTypeById(id);
    }
}
